import axios from "axios";

axios.defaults.withCredentials = true

// let base3 = 'http://localhost:8849/api';
let base3 = 'http://43.138.140.213:8849/api';
//传递json的post请求
export const postRequest3 = (url, params) => {
	return axios({
		method: 'post',
		url: `${base3}${url}`,
		data: params,
		xhrFields: {
			withCredentials: true // 这里设置了withCredentials
		}

	})
}
//传递json的put请求
export const putRequest3 = (url, params) => {
	return axios({
		method: 'put',
		url: `${base3}${url}`,
		data: params,
		xhrFields: {
			withCredentials: true // 这里设置了withCredentials
		}

	})
}
//传递json的get请求
export const getRequest3 = (url, params) => {
	return axios({
		method: 'get',
		url: `${base3}${url}`,
		data: params,
		xhrFields: {
			withCredentials: true // 这里设置了withCredentials
		}

	})
}
//传递json的delete请求
export const deleteRequest3 = (url, params) => {
	return axios({
		method: 'delete',
		url: `${base3}${url}`,
		data: params,
		xhrFields: {
			withCredentials: true // 这里设置了withCredentials
		}

	})
}
